package com.hjjt.baselib.util

import java.text.SimpleDateFormat
import java.util.*

/**
 *
 * @ProjectName:    IntelligentTerminal
 * @Package:        com.hjjt.baselib.util
 * @ClassName:      TimerUtil
 * @Description:
 * @Author:         孙浩
 * @CreateDate:     2022/7/25 11:26
 */
object TimeUtil {
    fun timeMillisToDateString(timeMillis: Long, pattern: String): String {
        val format = SimpleDateFormat(pattern)
        return format.format(timeMillis)
    }

    fun dateStringToMillis(dateString: String, pattern: String): Long {
        return SimpleDateFormat(pattern).parse(dateString)?.time ?: 0
    }

}



